var _Panel = new Class(
{
	getMain: function()
	{ 
		return this.main;
	},
	
	initialize: function(main)
	{
		this.main = main;
		
		// Set window settings
		this.WindowID = null;
		
		this.WindowTitle = null;
		
		this.WindowContents = null;
		
		this.WindowLoc = ['center', 'center'];
		this.WindowLocFixed = false;
		
		this.WindowSizeFixed = false;
		this.WindowSize = {x: 100, y: 100};
		
		this.WindowCloseByUser = false;
		
		this.WindowOnTop = null;
		
		this.WindowStyle = null;
		
		this.onContentUpdated = null;
		this.onTitleUpdated = null;
		
	}, // end function initialize
	
	setOnContentUpdated: function(func, atr)
	{
		this.onContentUpdated = {func: func, atr: atr};
		
	},
	
	setOnTitleUpdated: function(func, atr)
	{
		this.onTitleUpdated = {func: func, atr: atr};
		
	},
	
	updateTitle: function(t)
	{
		this.WindowTitle =t;
		
		chat.dialogs.triggerTitleUpdated(t, this.getID(), this.onTitleUpdated);
		
	},
	
	updateContents: function(c)
	{
		this.WindowContents = c;
		
		chat.dialogs.triggerContentsUpdated(c, this.getID(), this.onContentUpdated);
		
	},
	
	isOnTop: function()
	{
		return this.WindowOnTop;
		
	},
	
	canCloseByUser: function()
	{
		return this.WindowCloseByUser;
		
	},
	
	isLocFixed: function()
	{
		return this.WindowLocFixed;
		
	},
	
	isSizeFixed: function()
	{
		return this.WindowSizeFixed;
		
	},
	
	getStartLocation: function()
	{
		return this.WindowLoc;
		
	},
	
	getID: function()
	{
		return this.WindowID;
		
	},
	
	getTitle: function()
	{
		return this.WindowTitle;
		
	},
	
	getContent: function()
	{
		return this.WindowContents;
		
	},
	
	getSize: function()
	{
		var Output = {
			fixed: false,
			x: 0, 
			y: 0
		};
		
		if (this.WindowSizeFixed == true)
		{
			Output['fixed'] = true;
			
		} // end if
		
		Output['x'] = this.WindowSize['x'];
		Output['y'] = this.WindowSize['y'];
		
		return Output;
		
	}, // end function getSize
	
	getStyle: function()
	{
		return this.WindowStyle;
		
	}, // end function getCSS
	
	check: function()
	{
		var size = getSize();
		if (size['x'] < 0 || size['y'] < 0)
			return false;
		
		if (this.getTitle() == '')
			return false;
			
		if (this.getContent() == '')
			return false;
			
		return true;
		
	} // end function check
});

cimport_loaded('panels.base');
